/**
 * 
 * @Title: 冻结状态：0未冻结 1已冻结  
 * @Description: TODO
 * @author zzr
 * @date 2018年5月18日 10:00:10
 */

package org.example.enums;

public enum FreezeStatusEnum {

	WDJ("未冻结 ", 0),
    YDJ("已冻结", 1);

    private String name;
    private int index;

    private FreezeStatusEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (FreezeStatusEnum c : FreezeStatusEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (FreezeStatusEnum c : FreezeStatusEnum.values()) {
            if (c.getName().equals(name)) {
                return c.getIndex();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}

